/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "TAXE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Taxe.findAll", query = "SELECT t FROM Taxe t"),
    @NamedQuery(name = "Taxe.findByIdTaxe", query = "SELECT t FROM Taxe t WHERE t.idTaxe = :idTaxe"),
    @NamedQuery(name = "Taxe.findByCodetaxe", query = "SELECT t FROM Taxe t WHERE t.codetaxe = :codetaxe"),
    @NamedQuery(name = "Taxe.findBySens", query = "SELECT t FROM Taxe t WHERE t.sens = :sens"),
    @NamedQuery(name = "Taxe.findByIntitulecr", query = "SELECT t FROM Taxe t WHERE t.intitulecr = :intitulecr"),
    @NamedQuery(name = "Taxe.findByTauxtaxe", query = "SELECT t FROM Taxe t WHERE t.tauxtaxe = :tauxtaxe")})
public class Taxe implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_TAXE")
    private Integer idTaxe;
    @Basic(optional = false)
    @Column(name = "CODETAXE")
    private String codetaxe;
    @Basic(optional = false)
    @Column(name = "SENS")
    private short sens;
    @Basic(optional = false)
    @Column(name = "INTITULECR")
    private String intitulecr;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "TAUXTAXE")
    private BigDecimal tauxtaxe;
    @ManyToMany(mappedBy = "taxeCollection")
    private Collection<Compteg> comptegCollection;
    @OneToMany(mappedBy = "idTaxe")
    private Collection<Compteg> comptegCollection1;
    @JoinColumn(name = "ID_TYPETAXE", referencedColumnName = "ID_TYPETAXE")
    @ManyToOne(optional = false)
    private Typetaxe idTypetaxe;
    @JoinColumn(name = "ID_CG", referencedColumnName = "ID_CG")
    @ManyToOne(optional = false)
    private Compteg idCg;

    public Taxe() {
    }

    public Taxe(Integer idTaxe) {
        this.idTaxe = idTaxe;
    }

    public Taxe(Integer idTaxe, String codetaxe, short sens, String intitulecr,Typetaxe ttaxe) {
        this.idTaxe = idTaxe;
        this.codetaxe = codetaxe;
        this.sens = sens;
        this.intitulecr = intitulecr;
        this.idTypetaxe = ttaxe;
    }

    public Integer getIdTaxe() {
        return idTaxe;
    }

    public void setIdTaxe(Integer idTaxe) {
        this.idTaxe = idTaxe;
    }

    public String getCodetaxe() {
        return codetaxe;
    }

    public void setCodetaxe(String codetaxe) {
        this.codetaxe = codetaxe;
    }

    public short getSens() {
        return sens;
    }

    public void setSens(short sens) {
        this.sens = sens;
    }

    public String getIntitulecr() {
        return intitulecr;
    }

    public void setIntitulecr(String intitulecr) {
        this.intitulecr = intitulecr;
    }

    public BigDecimal getTauxtaxe() {
        return tauxtaxe;
    }

    public void setTauxtaxe(BigDecimal tauxtaxe) {
        this.tauxtaxe = tauxtaxe;
    }

    @XmlTransient
    public Collection<Compteg> getComptegCollection() {
        return comptegCollection;
    }

    public void setComptegCollection(Collection<Compteg> comptegCollection) {
        this.comptegCollection = comptegCollection;
    }

    @XmlTransient
    public Collection<Compteg> getComptegCollection1() {
        return comptegCollection1;
    }

    public void setComptegCollection1(Collection<Compteg> comptegCollection1) {
        this.comptegCollection1 = comptegCollection1;
    }

    public Typetaxe getIdTypetaxe() {
        return idTypetaxe;
    }

    public void setIdTypetaxe(Typetaxe idTypetaxe) {
        this.idTypetaxe = idTypetaxe;
    }

    public Compteg getIdCg() {
        return idCg;
    }

    public void setIdCg(Compteg idCg) {
        this.idCg = idCg;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTaxe != null ? idTaxe.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Taxe)) {
            return false;
        }
        Taxe other = (Taxe) object;
        if ((this.idTaxe == null && other.idTaxe != null) || (this.idTaxe != null && !this.idTaxe.equals(other.idTaxe))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Taxe[ idTaxe=" + idTaxe + " ]";
    }
    
}
